﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EditDemo.aspx.cs" Inherits="Demo_EditDemo"
    CodeFileBaseClass="Frame.Pages.ActionInfomationEditBasePage" %>

<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTreeView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2.Linq, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Data.Linq" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="../Scripts/EnterAsTab.js"></script>
    <script type="text/javascript">
        function DropDownHandler(s, e) {
            SynchronizeFocusedNode();
        }
        function TreeInitHandler(s, e) {
            SynchronizeFocusedNode();
        }
        function NodeClickHandler(s, e) {
            Edit_bmbm.SetKeyValue(e.node.name);
            Edit_bmbm.SetText(e.node.GetText());
            Edit_bmbm.HideDropDown();
        }
        function ExpandedChangedHandler(s, e) {
            Edit_bmbm.AdjustDropDownWindow();
        }

        function SynchronizeFocusedNode() {
            var keyValue = Edit_bmbm.GetKeyValue();
            Tree.SetSelectedNode(Tree.GetNodeByName(keyValue));
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <dx:ASPxRoundPanel ID="MainRoundPanel" runat="server" View="GroupBox" Width="100%"
            CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
            EnableDefaultAppearance="False" GroupBoxCaptionOffsetX="6px" GroupBoxCaptionOffsetY="-19px"
            SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
            <ContentPaddings PaddingBottom="10px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="10px" />
            <HeaderStyle>
                <Paddings PaddingBottom="6px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="3px" />
            </HeaderStyle>
            <PanelCollection>
                <dx:PanelContent runat="server" SupportsDisabledAttribute="True">
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxRoundPanel>
        <dx:ASPxGridView ID="gridView" runat="server" Width="100%" AutoGenerateColumns="False"
            CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
            DataSourceID="LSMDSourceMain" KeyFieldName="rybm" OnHtmlEditFormCreated="gridView_HtmlEditFormCreated"
            OnCellEditorInitialize="gridView_CellEditorInitialize">
            <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue">
                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                </Header>
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
                <AlternatingRow Enabled="true" />
            </Styles>
            <ImagesFilterControl>
                <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanel>
            </ImagesFilterControl>
            <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanelOnStatusBar>
                <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanel>
            </Images>
            <Styles>
                <CommandColumn Spacing="5px" Wrap="False" />
            </Styles>
            <Columns>
                <dx:GridViewDataTextColumn Name="t_rybm" FieldName="rybm" VisibleIndex="0" CellStyle-HorizontalAlign="Left"
                    Caption="人员编码">
                    <PropertiesTextEdit MaxLength="40" Width="260px" Style-Font-Size="10pt">
                        <ValidationSettings CausesValidation="true">
                            <RequiredField IsRequired="true" ErrorText="人员编码不可为空！"></RequiredField>
                        </ValidationSettings>
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Name="t_ryxm" FieldName="ryxm" VisibleIndex="1" CellStyle-HorizontalAlign="Left"
                    Caption="人员名称">
                    <PropertiesTextEdit MaxLength="40" Width="260px">
                        <ValidationSettings CausesValidation="true">
                            <RequiredField IsRequired="true" ErrorText="人员名称不可为空！"></RequiredField>
                        </ValidationSettings>
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataDropDownEditColumn Name="t_bmbm" FieldName="bmbm" VisibleIndex="2"
                    CellStyle-HorizontalAlign="Left" Caption="部门编码">
                    <PropertiesDropDownEdit Width="260px" Style-Font-Size="10pt">
                        <DropDownWindowTemplate>
                            <dx:ASPxTreeView ID="Tree" ClientInstanceName="Tree" runat="server" AllowSelectNode="true">
                                <ClientSideEvents Init="TreeInitHandler" NodeClick="NodeClickHandler" ExpandedChanged="ExpandedChangedHandler" />
                            </dx:ASPxTreeView>
                        </DropDownWindowTemplate>
                        <ClientSideEvents DropDown="DropDownHandler" />
                    </PropertiesDropDownEdit>
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                </dx:GridViewDataDropDownEditColumn>
                <%--                <dx:GridViewDataComboBoxColumn Name="t_bmbm" FieldName="bmbm" VisibleIndex="2" CellStyle-HorizontalAlign="Left"
                    Caption="部门编码">
                    <PropertiesComboBox Width="260px" Style-Font-Size="10pt" IncrementalFilteringMode="StartsWith">
                    </PropertiesComboBox>
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataComboBoxColumn>--%>
                <dx:GridViewDataTextColumn Name="t_pwd" FieldName="pwd" VisibleIndex="3" CellStyle-HorizontalAlign="Left"
                    Caption="密码">
                    <PropertiesTextEdit MaxLength="200" Native="true" Width="260px">
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
            </Columns>
            <StylesPager>
                <PageNumber ForeColor="#3E4846">
                </PageNumber>
                <Summary ForeColor="#1E395B">
                </Summary>
            </StylesPager>
            <StylesEditors ButtonEditCellSpacing="0">
                <ProgressBar Height="21px">
                </ProgressBar>
            </StylesEditors>
            <Settings GridLines="None" />
            <Settings ShowFilterRow="true" ShowFilterRowMenu="true" ShowFilterBar="visible" ShowHeaderFilterButton="true" />
            <SettingsBehavior AllowSelectByRowClick="true" />
            <SettingsEditing EditFormColumnCount="1" Mode="PopupEditForm" PopupEditFormModal="true"
                PopupEditFormHorizontalAlign="WindowCenter" PopupEditFormVerticalAlign="WindowCenter" />
        </dx:ASPxGridView>
        <dx:LinqServerModeDataSource ID="LSMDSourceMain" runat="server" EnableDelete="true"
            EnableUpdate="true" EnableInsert="true" ContextTypeName="DAL.DataClassesDataContext"
            TableName="css_user" />
    </div>
    </form>
</body>
</html>
